/*    */ package com.hs.activation.common.config;
/*    */ 
/*    */ import java.util.concurrent.Executor;
/*    */ import java.util.concurrent.ThreadPoolExecutor;
/*    */ import org.springframework.context.annotation.Bean;
/*    */ import org.springframework.context.annotation.Configuration;
/*    */ import org.springframework.scheduling.annotation.EnableAsync;
/*    */ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Configuration
/*    */ @EnableAsync
/*    */ public class TaskPoolConfig
/*    */ {
/*    */   @Bean({"taskExecutor"})
/*    */   public Executor taskExecutor() {
/* 23 */     ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
/* 24 */     taskExecutor.setCorePoolSize(50);
/* 25 */     taskExecutor.setMaxPoolSize(500);
/* 26 */     taskExecutor.setQueueCapacity(1000);
/* 27 */     taskExecutor.setKeepAliveSeconds(200);
/* 28 */     taskExecutor.setThreadNamePrefix("taskExecutor--");
/* 29 */     taskExecutor.setWaitForTasksToCompleteOnShutdown(true);
/* 30 */     taskExecutor.setAwaitTerminationSeconds(200);
/* 31 */     taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
/* 32 */     return (Executor)taskExecutor;
/*    */   }
/*    */ }


/* Location:              C:\Users\yzc\Desktop\新建文件夹 (3)\activation-0.0.16.jar!\BOOT-INF\classes\com\hs\activation\common\config\TaskPoolConfig.class
 * Java compiler version: 16 (60.0)
 * JD-Core Version:       1.1.3
 */